package user_local_ewallet

import (
	"context"

	"gitee.com/liuxuezhan/ar-platform/assets-api/internal/svc"
	"gitee.com/liuxuezhan/ar-platform/assets-api/internal/types"
	"gitee.com/liuxuezhan/ar-platform/assets-api/pkg/emun"
	"github.com/zeromicro/go-zero/core/logx"
)

type UserLocalEWalletTypeLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

// 本地电子钱包钱包类型
func NewUserLocalEWalletTypeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserLocalEWalletTypeLogic {
	return &UserLocalEWalletTypeLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *UserLocalEWalletTypeLogic) UserLocalEWalletType() (resp *types.UserLocalEwalletTypeResponse, err error) {
	var enumData []types.Emun
	for key, value := range emun.PaymentChannelMap {
		enumData = append(enumData, types.Emun{
			Key:   int32(key),
			Value: value,
		})
	}

	return &types.UserLocalEwalletTypeResponse{
		EmunData: enumData,
	}, nil
}
